package com.cb.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.jia.entity.Booking;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
* @author JIASC
* @description 针对表【t_booking】的数据库操作Mapper
* @createDate 2024-05-08 21:09:56
* @Entity com.jia.domain.Booking
*/
public interface BookingMapper extends BaseMapper<Booking> {

    @Select("select * from t_booking where uid = #{uid} and cid = #{cid} and state = 0")
    Booking findByUidAndEid(@Param("uid") Integer uid, @Param("cid") Integer cid);

    @Update("update t_booking set state = 2 where uid = #{uid} and cid = #{cid} and state = 0")
    void updateState(@Param("uid") Integer uid, @Param("cid") Integer cid);

    @Select("select * from t_booking where uid = #{uid} and cid = #{cid} and state = 0")
    Booking sel(@Param("uid") Integer uid, @Param("cid") Integer cid);
}




